package com.hongye.backstage.controller;

import com.hongye.backstage.entity.HongyeIssueTypeEntity;
import com.hongye.backstage.service.HongyeIssueTypeService;
import com.hongye.common.enu.ResultEnum;
import com.hongye.common.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author fyd
 * @email 2104371759@qq.com
 * @date 2022/4/20
 * @time 9:33
 */
@RestController
@RequestMapping("/backstage/issueType")
public class HongyeIssueTypeController {

    @SuppressWarnings("all")
    @Autowired
    private HongyeIssueTypeService hongyeIssueTypeService;

    /**
     * 获取所有发布类型
     * @return
     */
    @RequestMapping("/getIssueTypeListAll")
    public ResponseResult<List<HongyeIssueTypeEntity>> getIssueTypeListAll(){
        List<HongyeIssueTypeEntity> typeList = hongyeIssueTypeService.getIssueTypeListAll();
        ResponseResult<List<HongyeIssueTypeEntity>> result = new ResponseResult<>();
        result.setData(typeList);
        result.setSuccess(ResultEnum.SUCCESS.getSuccess());
        result.setCode(ResultEnum.SUCCESS.getCode());
        result.setMessage(ResultEnum.SUCCESS.getMessage());
        return result;
    }


}
